import { request } from '@/utils/request.js'

// 登录
export function loginApi(data) {
  return request({
    url: '/api/v1/hospital/login',
    method: 'POST',
    data
  })
}

// 注册
export function registerApi(data) {
  return request({
    url: '/api/v1/hospital/register',
    method: 'POST',
    data
  })
}

// 发送验证码
export function sendCode(data) {
  return request({
    url: '/api/v1/hospital/sendCode',
    method: 'POST',
    data
  })
}

// 重置密码
export function resetPwd(data) {
  // "email": "string",
  // "new_password": "string",
  // "email_code": "string"

  return request({
    url: '/api/v1/hospital/resetPasswd',
    method: 'POST',
    data
  })
}

// 获取用户列表
export function getMembers(data) {
  return request({
    url: `/api/v1/hospital/member?pageSize=${data.pageSize}&page=${data.page}&username=${data.name}&name=${data.name}`,
    method: 'get'
  })
}
// 更新用户信息
export function updateUserInfo(data) {
  return request({
    url: `/api/v1/hospital/member/${data.user_id}`,
    method: 'put',
    data
  })
}

// 重置签名
export function resetSignature(data) {
  return request({
    url: '/api/v1/hospital/resetSignature',
    method: 'POST',
    data
  })
}

// 上传签名
export function uploadSignature(data) {
  return request({
    url: '/api/v1/hospital/uploadSignature',
    method: 'POST',
    data
  })
}

export function deleteUser(data) {
  return request({
    url: '/api/v1/public/delete_user',
    method: 'POST',
    data: data
  })
}
